<script setup lang="ts">
import Cookies from "js-cookie"
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import Layout from '@/layout/index.vue'
import { useAuth } from '@/stores/index'

const { setInfo, clearInfo } = useAuth()
const info = localStorage.getItem('info')
const token = Cookies.get('token')

if (token && info) {
    setInfo(JSON.parse(info))
} else if (info) {
    clearInfo()
}

</script>

<template>
    <el-config-provider :locale="zhCn">
        <Layout />
        <PaletteButton />
    </el-config-provider>
</template>

<style lang="scss"></style>
